//
//  ListCollectionViewCell.m
//  GiftNote
//
//  Created by wsh on 15/8/12.
//  Copyright (c) 2015年 GN. All rights reserved.
//

#import "ListCollectionViewCell.h"
#import "Screen.h"
#import "UIImageView+WebCache.h"

@implementation ListCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        _mainImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width , frame.size.height - 30)];
        
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, frame.size.height - 30, frame.size.width, 30)];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_mainImageView];
        [self.contentView addSubview:_titleLabel];
        
    }
    return self;
}


- (void)setModel:(channelsModel *)model{
    _model = model;
    
    [_mainImageView sd_setImageWithURL:[NSURL URLWithString:model.icon_url]];
    
    _titleLabel.text = model.name;
    
}


@end
